﻿<?xml version="1.0" encoding="utf-8" ?>
<Content type="xform" name="EditContent">
  <model>
    <instance>
      <tblContent>
        <nContentKey/>
        <nContentPrimaryId/>
        <nVersion/>
        <cContentForiegnRef/>
        <cContentName/>
        <cContentSchemaName>Ticket</cContentSchemaName>
        <cContentXmlBrief>
          <Content>
            <Name/>
            <StockCode gtin="" mpn=""/>          
            <ShippingWeight/>
            <Stock/>
            <MinStock/>
            <Availability/>
            <StartDate/>
            <EndDate/>
            <Times start="" end="" /> 
            <Images>
              <img class="detail"/>
            </Images>
            <Prices>
              <Price currency="GBP" validGroup="all" type="rrp"/>
              <Price currency="GBP" validGroup="all" type="sale"/>
            </Prices>
            <Options>
              <OptGroup type="Options1" selectType="hidden" name="Event">
                <option/>
              </OptGroup>
              <OptGroup type="Options2" selectType="hidden" name="Date">
                <option/>
              </OptGroup>
            </Options>
          </Content>
        </cContentXmlBrief>
        <cContentXmlDetail>
          <Content>
            <Name/>
            <StockCode gtin="" mpn=""/>           
            <ShippingWeight/>
            <Stock/>
            <MinStock/>
            <Availability/>
            <StartDate/>
            <EndDate/>
            <Times start="" end="" />
            <Images>
              <img class="detail"/>
            </Images>
            <Prices>
              <Price currency="GBP" validGroup="all" type="rrp"/>
              <Price currency="GBP" validGroup="all" type="sale"/>
            </Prices>
            <Options>
              <OptGroup type="Options1" selectType="DropDown" name="Event">
                <option/>
              </OptGroup>
              <OptGroup type="Options2" selectType="DropDown" name="Date">
                <option/>
              </OptGroup>
            </Options>
          </Content>
        </cContentXmlDetail>
        <nAuditId/>
        <nAuditKey/>
        <dPublishDate/>
        <dExpireDate/>
        <dInsertDate/>
        <nInsertDirId/>
        <dUpdateDate/>
        <nUpdateDirId/>
        <nStatus>1</nStatus>
        <cDescription/>
      </tblContent>
    </instance>
    <submission id="EditContent" action="" method="post" event="return form_check(this)"/>
    <bind nodeset="tblContent">
      <bind id="cContentForiegnRef" nodeset="cContentForiegnRef" required="false()" type="string"/>
      <bind id="cContentName" nodeset="cContentName" required="true()" type="string"/>
      <bind id="dPublishDate" nodeset="dPublishDate" required="false()" type="string"/>
      <bind id="dEventEndDate" nodeset="dExpireDate" required="false()" type="string"/>
      <bind id="nStatus" nodeset="nStatus" required="true()" type="string"/>
      <bind id="cDescription" nodeset="cDescription" required="false()" type="string"/>
      <bind nodeset="cContentXmlBrief/Content">
        <bind id="cContentName" nodeset="Name" required="true()" type="string"/>
        <bind id="cContentSKU" nodeset="StockCode" required="true()" type="string"/>
        <bind id="dEventDate" nodeset="StartDate" required="false()" type="string"/>
        <bind id="dEventEndDate" nodeset="EndDate" required="false()" type="string" constraint="translate(//cContentXmlDetail/Content/EndDate,'-','') &gt;= translate(//cContentXmlDetail/Content/StartDate,'-','')">
          <alert>End date must be the same day or later than the Start date</alert>
        </bind>
        <!--<bind id="cContentTimes" nodeset="Times" required="false()" type="string"/>-->
        <bind nodeset="Times">
          <bind id="cContentSTime" nodeset="@start" required="false()" type="string"/>
          <bind id="cContentETime" nodeset="@end" required="false()" type="string"/>
        </bind>
        <bind id="cContentPrice" nodeset="Prices/Price[@type='sale']" required="false()" type="number"/>
        <bind id="cContentPriceRRP" nodeset="Prices/Price[@type='rrp']" required="false()" type="string"/>
        <bind nodeset="Images">
          <bind id="cContentDetail" nodeset="img[@class='detail']" required="false()" type="xml-replace"/>
        </bind>
        <bind id="cContentStock" nodeset="Stock" required="false()" type="string"/>
      </bind>
      <bind nodeset="cContentXmlDetail/Content">
        <bind id="cContentName" nodeset="Name" required="true()" type="string"/>
        <bind id="cContentSKU" nodeset="StockCode" required="true()" type="string"/>
        <bind id="dEventDate" nodeset="StartDate" required="true()" type="string"/>
        <bind id="dEventEndDate" nodeset="EndDate" required="false()" type="string" constraint="translate(//cContentXmlDetail/Content/EndDate,'-','') &gt;= translate(//cContentXmlDetail/Content/StartDate,'-','')">
          <alert>End date must be the same day or later than the Start date</alert>
        </bind>
        <!--<bind id="cContentTimes" nodeset="Times" required="false()" type="string"/>-->
        <bind nodeset="Times">
          <bind id="cContentSTime" nodeset="@start" required="false()" type="string"/>
          <bind id="cContentETime" nodeset="@end" required="false()" type="string"/>
        </bind>
        <bind id="cContentPrice" nodeset="Prices/Price[@type='sale']" required="true()" type="number"/>
        <bind id="cContentPriceRRP" nodeset="Prices/Price[@type='rrp']" required="false()" type="string"/>
        <bind nodeset="Images">
          <bind id="cContentDetail" nodeset="img[@class='detail']" required="false()" type="xml-replace"/>
        </bind>
        <bind id="cContentStock" nodeset="Stock" required="false()" type="string"/>
      </bind>
    </bind>
  </model>
  <group ref="EditContent" class="2col">
    <label>Edit Ticket</label>
    <group class="ContentColumn1">
      <group ref="Settings" class="leftSettings">
        <input bind="nContentKey" class="hidden">
          <label>ContentId</label>
        </input>
        <label>Settings</label>
        <!--<input bind="cContentForiegnRef" class="short">
					<label>Foriegn Reference</label>
				</input>-->
        <input bind="dPublishDate" class="calendar short">
          <label>Publish Date</label>
        </input>
        <input bind="dExpireDate" class="calendar short">
          <label>Expire Date</label>
        </input>
        <select1 bind="nStatus" appearance="full" class="required vshort">
          <label>Status</label>
          <item>
            <label>Live</label>
            <value>1</value>
          </item>
          <item>
            <label>Hidden</label>
            <value>0</value>
          </item>
        </select1>
        <!--<input bind="cDescription" class="short">
					<label>Change Notes</label>
				</input>-->
      </group>

      <group class="Content">
        <label>Images</label>
        <input bind="cContentDetail" class="short pickImage">
          <label>Main ticket image</label>
          <help class="inline">
            <p>The main image is automatically resized for other smaller images such as thumbnails.</p>
            <p>However if you would like a different image for the thumbnail or main product page, they can be specified below.</p>
          </help>
        </input>
        <input bind="cContentThumbnail" class="short pickImage">
          <label>Alternative thumbnail</label>
        </input>
      </group>

    </group>

    <group class="ContentColumn2">
      <group ref="Content" class="Content required">
        <label>Ticket Details</label>

        <input bind="cContentName" class="long required">
          <label>Ticket name</label>
          <!--<help class="inline">
            <p>Should be unique to the ticket e.g.</p>
            <p>
              Michael Buble <b>15th December, 7:30pm</b>
            </p>
          </help>-->
        </input>
        <group class="inline">
          <input bind="cContentSKU" class="short required">
            <label>Stock code (SKU)</label>
            <help class="inline">Unique stock code, matching your back-office system if you have one.</help>
          </input>
          <input bind="cContentStock" class="short">
            <label>Stock level</label>
            <help class="inline">If stock control is enabled, this value will reduce as a quantity is successfully sold.</help>
          </input>
        </group>

      </group>

      <group class="inline">
        <label>Ticket Date and Times</label>
        <input bind="dEventDate" class="calendar form-inline">
          <label>Start Date</label>
        </input>
        <input bind="dEventEndDate" class="calendar form-inline ">
          <label>End date</label>
        </input>
        <input bind="cContentSTime" class="time form-inline ">
          <label>Start time</label>
        </input>
        <input bind="cContentETime" class="time form-inline ">
          <label>End time</label>
        </input>
      </group>


      <group class="inline">
        <label>Prices</label>
        <input bind="cContentPrice" class="short required">
          <label>Purchase price</label>
          <help class="inline">
            <p>The price a customer can purchase the ticket for.</p>
          </help>
        </input>
        <input bind="cContentPriceRRP" class="short">
          <label>RRP</label>
          <help class="inline">
            <p>Optional. If an RRP is specified, it will display to the user;</p>
            <p>
              RRP: £10.00<br/><b>Now: £8.50</b>
            </p>
            <p>If ecommerce, the user will still pay the 'purchase price'.</p>
          </help>
        </input>
      </group>

    </group>
  </group>

  <group ref="submit" class="contentSubmit">
    <submit submission="" ref="ewSubmit" class="principle">
      <label>Save Ticket</label>
    </submit>
  </group>
</Content>